package cn.itcast.zt.schedule;

import cn.itcast.zt.annotation.CronSchedule;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author zhangtian105
 * @ClassName ScheduleJobTask.java
 * @projectName SpringBoot2.x
 * @Description 定义定时任务
 * @createTime 2020年04月27日 17:22:00
 */
@Component
@Slf4j
public class ScheduleJobTask {

    public static final String GLOBAL_CRON = "0/30 * * * * ?" ; // 定义全局cron，用户测试替换表达式，重新注册定时任务

    @CronSchedule(cron = "0/1 * * * * ?", desc = "demo1定时处理")
    public void computeScheduleDemo1() {
        log.info("定时任务Demo1执行......");
    }

    @CronSchedule(cron = "0/5 * * * * ?", desc = "demo2定时处理")
    public void computeScheduleDemo2() {
        log.info("定时任务Demo2执行......");
    }
}
